package com.plata.base;

import java.util.concurrent.LinkedBlockingQueue;

public class MyLinkedBlockQueue<E> extends LinkedBlockingQueue<E> {

    public MyLinkedBlockQueue() {
        this(Integer.MAX_VALUE);
    }

    public MyLinkedBlockQueue(int capacity) {
        super(capacity);
    }

    @Override
    public E take() throws InterruptedException {
        try {
            return super.take();
        } catch (InterruptedException e) {
            throw e;
        } catch (NullPointerException e) {
            return null;
        }
    }
}
